package Guess;

import java.util.Scanner;

/**
 * @Author admin
 * @Date 2019/3/15 8:17
 */
public class Test {
    public static void main(String[] args) {
        /**让对象做：产生随机数，判断猜大猜小，猜测次数
         * 自己做的事情：接受用户输入数字，根据猜测结果决定是否要重复让用户输入
         * */
        Guess guess =new Guess();
        guess.getRandom();
        System.out.println("随机数已经产生");
        String result="";
        do {
            System.out.println("请输入要猜测的值：");
            Scanner in=new Scanner(System.in);
            int g=in.nextInt();
            result=guess.judge(g);
            System.out.println(result);
        }while (!result.equals("binGo"));

        System.out.println("共猜测了"+guess.getCount()+"次");
        System.out.println("Game over!");
    }
}
